package com.zyl.pts.config.validated;

import com.zyl.pts.config.anno.Vaccines;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @version v1.0
 * @ProjectName: product_source
 * @Package: com.zyl.pts.config.validated
 * @ClassName: VaccinesValidated
 * @Description TODO()
 * @Author 翟玉龙
 * @Date 2024/11/21-9:39
 */
public class VaccinesValidated implements ConstraintValidator<Vaccines, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if(s == null || s.isEmpty()) {
            return false;
        }
        return "已接种".equals(s) ||
                "未接种".equals(s);
    }
}
